import safeSvg from '@/assets/svg/risk_safe.svg';
import highSvg from '@/assets/svg/risk_high.svg';
import middleSvg from '@/assets/svg/risk_middle.svg';
import lowSvg from '@/assets/svg/risk_low.svg';

export const USEABLE_DEAD_MAP = {
  true: { color: 'color-red', text: '响应异常' },
  false: { color: 'color-green', text: '响应正常' },
  null: { color: 'color-gray', text: '未知' },
};
export const USEABLE_HIJAKED_MAP = {
  true: { color: 'color-red', text: '有DNS劫持' },
  false: { color: 'color-green', text: '无DNS劫持' },
  null: { color: 'color-gray', text: '未知' },
};
export const RISK_LEVE_MAP = {
  3: { img: highSvg, color: '#BB0707', text: '高危' },
  2: { img: middleSvg, color: '#F67E23', text: '中危' },
  1: { img: lowSvg, color: '#FED831', text: '低危' },
  0: { img: safeSvg, color: '#11AB4E', text: '安全' },
  null: { img: null, color: '#999ea8', text: '未知' },
};
export const MONTOR_AVILIABLE_MAP = [
  { label: '域名解析速度', value: 'dns' },
  { label: '页面读取速度', value: 'http_get_full_time' },
  { label: 'Ping监测', value: 'ping' },
  { label: 'HTTP监测', value: 'http_get' },
];
export const TIME_TYPE = [
  { value: 'm', label: '分钟' },
  { value: 'h', label: '小时' },
  { value: 'd', label: '天' },
];
export const EVENT_SEVERITY = {
  CRITICAL: ['严重', 'rgb(171, 0, 11)'],
  HIGH: ['高危', '#f04038'],
  MEDIUM: ['中危', '#f87b10'],
  LOW: ['低危', '#fed831'],
  INFO: ['信息', '#999EA8'],
  // UNKNOWN: ['未知', '#CBD1DA'],
};
export const SECURITY_MAP = {
  black_links: ['暗链', '#f04038'],
  cryptojacking: ['挖矿', '#f04038'],
  malscan: ['挂马', '#f04038'],
  // seo_hijack: ['SEO劫持', '#f04038'],
  broken_links: ['坏链', '#fed831'],
  keyword: ['敏感词', '#fed831'],
  privacy_disclosure: ['隐私信息', '#fed831'],
};
export const WARNING_SECURITYEVENT_MAP = {
  black_links: '暗链',
  cryjack: '挖矿',
  malscan: '挂马',
  broken_links: '坏链',
  foreign_links: '风险外链',
  icp: '未备案',
  keyword: '敏感词',
  domain: '风险域名',
  risk_link: '风险外链',
};
export const NotifyType = { 0: '未知', 1: '任务创建成功进入调度', 2: '任务到达应当执行的时间点进入执行队列', 3: '任务开始实际执行', 7: '任务中止中', 8: '监测停止', 9: '监测成功', 10: '监测失败', 11: '任务被删除', 12: 'Event 结果推送', 13: 'Urls 结果推送' }
export const WARNING_SECURITYEVENT_MAP2 = {
  black_links: '暗链',
  cryptojacking: '挖矿',
  malscan: '挂马',
  broken_links: '坏链',
  foreign_links: '风险外链',
  privacy_disclosure: '隐私信息',
  keyword: '敏感词',
  image_check: 'Image 检测',
  domain: '风险域名',
  seo_hijack: 'SEO劫持',
  availability: '可用性',
  securityEvent: '安全事件',
  vul: '漏洞',
  risk_link: '风险外链',
  change_check: '篡改'
};
export const BUG_GRADE = ['未知', '信息', '低危', '中危', '高危', '严重'];
/**
 * 内容合规
 */
export const CONTENT_KEYWORD_TYPES = [
  { idx: 9, key: 'chatgpt', label: 'ChatGPT' },
  { idx: 1, key: 'politics', label: '政治' },
  { idx: 2, key: 'pornography', label: '涉黄' },
  { idx: 3, key: 'reaction', label: '反动' },
  { idx: 4, key: 'gangland', label: '涉黑' },
  { idx: 5, key: 'violence', label: '暴恐' },
  { idx: 6, key: 'bet', label: '博彩' },
  { idx: 7, key: 'livelihood', label: '民生' },
  { idx: 8, key: 'others', label: '其他' },
];
export const CONTENT_KEYWORD_IDX_LABEL_MAP = CONTENT_KEYWORD_TYPES.reduce((obj, x) => {
  obj[x.idx] = x.label;
  return obj;
}, {});
// 证书模块定义
export const MODULES = {
  availability: '本地可用性',
  cloud: '云端可用性',
  vul: '漏洞',
  securityEvent: '安全事件',
  risk_link: '风险外链',
  change_check: '篡改',
  target_info: '业务系统信息',
  vul_verification_task: '漏洞验证',
  api: '二次开发API',
}
export const SECURITY_MODULES = {
  black_links: '暗链',
  cryptojacking: '挖矿',
  malscan: '挂马',
  keyword: '敏感词',
  privacy_disclosure: '敏感信息',
}
